package com.lovo.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lovo.bean.Tender2;
import com.lovo.service.ITender2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author lovo
 * @since 2022-09-17
 */
@RestController
@RequestMapping("hd/tender2")
public class Tender2Controller {

    @Autowired
    ITender2Service service;

    @GetMapping("sendTender")
    public String sendTender( Tender2 tender2) {
        service.sendTender(tender2);

        return "ok";
    }

    @PutMapping("updateTender/{tendId}")
    public String updateTender(@PathVariable("tendId") Integer tendId) {
        service.updateTender(tendId);
        return "ok";
    }

    @GetMapping("findAllTender/{pageNo}")
    public IPage<Tender2> sendTender(@PathVariable("pageNo") Integer pageNo) {
        return service.findAllTender(pageNo);
    }

}
